from rich.markdown import Markdown
from rich.console import Console

METAVAR_HELP = '\033[1;36mcommand\033[0m'
INFO_HELP = '\033[1;37mShow information about the weather\033[0m'
WEATHER_INFO_HELP = '\033[1;37mWeather information for \033[1;36mnow, hours, days or warning\033[0m'
WEATHER_NOW_HELP = '\033[1;37mShow weather forecast for now\033[0m'
WEATHER_HOURS_HELP = '\033[1;37mShow weather forecast for \033[1;36m24, 72 or 168\033[1;37m hours\033[0m'
WEATHER_DAYS_HELP = '\033[1;37mShow weather forecast for \033[1;36m3, 7, 10, 15 or 30\033[1;37m days\033[0m'
WEATHER_WARNING_HELP = '\033[1;37mShow weather warning\033[0m'
WEATHER_INDICES_HELP = '\033[1;37mShow weather indices for \033[1;36m1 or 3\033[1;37m days\033[0m'
WEATHER_HISTORY_HELP = '\033[1;37mShow weather history for up to \033[1;36m10 days\033[0m'
LOCATION_HELP = '\033[1;37mCity name in English or Chinese e.g. \033[1;36m北京/Beijing\033[0m'
LANGUAGE_HELP = '\033[1;37mLanguage e.g. \033[1;36men/zh\033[0m'
UNIT_HELP = '\033[1;37mUnit in metric or imperial e.g. \033[1;36mm/i\033[0m'
NUM_HOURS_HELP = '\033[1;37mNumber of hours \033[1;36m(24, 72, 168)\033[0m'
NUM_DAYS_HELP = '\033[1;37mNumber of days \033[1;36m(3, 7, 10, 15, 30)\033[0m'
INDICES_NUM_DAYS_HELP = '\033[1;37mNumber of days \033[1;36m(1, 3)\033[0m'
INDICES_TYPE_HELP = '\033[1;37mType of indices \033[1;36m(0~16)\033[0m'
HISTORY_DATE_HELP = '\033[1;37mDate in YYYYMMDD format\033[0m'

def print_docs(doc: str) -> None:
    """### Print documents from markdown"""
    console = Console()
    with open(f'docs/weather_{doc}.md', 'r', encoding='utf-8') as f:
        docs = f.read()
    md = Markdown(docs, justify='left')
    console.print(md)
